#ifndef __STRING_OPERATION_H
#define __STRING_OPERATION_H

#include "string.h"
/*
时间：2018 5 1
作者:latefly
功能：如下

这里要实现的函数有
StringReverse 字符串反转顺序
SplitString
IntString
StringInt
FloatString
StringFloat
DoubleString
StringDouble
StringEqual
StringCopy
HasSymbol 判断是否含有某一个字符串
StringTrim
StringLength
edit version 2018 7 23
edit version 2023 11 12

*/

/****************************************************************************************************/
//基础的字符判定定义
#define IS_CHARACTER(x) ((x>='a'&&x<='z')||(x>='A'&&x<='Z'))
#define IS_NUM(x)       (x>='0'&&x<='9')
#define IS_SIGN(x)     ((IsNum(x))||(IS_CHARACTER(x))||(x=='_'))
#define IS_DEFINE(x)     (x=='#')
//#define IS_BOUND_START(x)      (*(x)=='/'&&(*(x++)=='*'||*(x++)=='/'))
//#define IS_BOUND_END(x)          (*(x)=='*'&&*(x++)=='/')
#define IS_OPERATOR(x)   (x=='+'||x=='-'||x=='*'||x=='/')
//用于保存结果
#define STRING_OPERATION_BUFF_DEEP 16
#define STRING_OPERATION_BUFF_SIZE 64


//下面是一些字符串的操作相关的函数

void string_buff_empty(void);

char get_string_buff_used_length(void);

int string_length(char *s);

char string_trim(char symbol, char *s);

char string_copy(char *source, char *target);

char string_combine(char *source, char *target);

char string_reverse(char *s);//字符串顺序反转
char string_split(char split, char *s);//拆分以后 不含拆分符号
char string_equal(char *s1, char *s2);
char string_case_equal(char *s1, char *s2);

char has_symbol(char symbol, char *s);
char has_symbols_by_index(char *symbols, char *s,int index);
int string_find_symbol_index(char symbol, char *s);

int string_to_int(char *s);//转换结果有问题还未解决
float string_to_float(char *s);

double string_to_double(char *s);

char *int_to_string(int num);

char *float_to_string(float number);

char *double_to_string(double number);

char *string_replace(char *source, char *target, int index);


#endif
